package pers.vic.widget.automation.baidu.dao;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import pers.vic.widget.automation.baidu.model.BaiduCookie;

/**
 * @author Vic.xu
 * @description:
 * @date: 2021/8/27 0027 8:51
 */
@Repository
public class BaiduCookieDao {

    @Resource
    private JdbcTemplate jdbcTemplate;

    public List<BaiduCookie> cookieList() {
        String sql = "SELECT a.`id`, a.`name`, a.`cookie`, a.`sign_tbs` AS signTbs FROM baidu_cookie a WHERE 1=1 ";
        List<BaiduCookie> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<BaiduCookie>(BaiduCookie.class));
        return list;
    }
}
